//package com.heima.search;
//
//import com.heima.model.article.pojos.ApArticle;
//import com.heima.model.search.pojos.ApAssociateWords;
//import com.heima.search.mapper.AddMapper;
//import org.junit.jupiter.api.Test;
//import org.springframework.boot.test.context.SpringBootTest;
//import org.springframework.data.mongodb.core.MongoTemplate;
//
//import javax.annotation.Resource;
//import java.util.List;
//
//@SpringBootTest
//public class add {
//    @Resource
//    AddMapper addMapper;
//    @Resource
//    MongoTemplate mongoTemplate;
//
//    @Test
//    public void add() {
//        ApAssociateWords associateWords = new ApAssociateWords();
//        List<ApArticle> articles = addMapper.add();
//        for (ApArticle article : articles) {
//            ApAssociateWords apAssociateWords = new ApAssociateWords();
//            apAssociateWords.setAssociateWords(article.getTitle());
//            apAssociateWords.setCreatedTime(article.getCreatedTime());
//            mongoTemplate.save(apAssociateWords);
//        }
//    }
//
//
//}
